home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / newrouts / addvars.frm (.txt) < prev    next >
Visual Basic Form  |  1997-06-12  |  5KB  |  170 lines

  1. VERSION 4.00
  2. Begin VB.Form frmAddVariables 
  3.    Caption         =   "Add Variables"
  4.    ClientHeight    =   3315
  5.    ClientLeft      =   4065
  6.    ClientTop       =   2850
  7.    ClientWidth     =   6105
  8.    Height          =   3720
  9.    Icon            =   "AddVars.frx":0000
  10.    Left            =   4005
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   3315
  13.    ScaleWidth      =   6105
  14.    Top             =   2505
  15.    Width           =   6225
  16.    Begin VB.CommandButton cmdDel 
  17.       Caption         =   "&Del"
  18.       Height          =   315
  19.       Left            =   5160
  20.       TabIndex        =   8
  21.       Top             =   2550
  22.       Width           =   840
  23.    End
  24.    Begin VB.TextBox txtNewVarDesc 
  25.       BeginProperty Font 
  26.          name            =   "Fixedsys"
  27.          charset         =   0
  28.          weight          =   400
  29.          size            =   9
  30.          underline       =   0   'False
  31.          italic          =   0   'False
  32.          strikethrough   =   0   'False
  33.       EndProperty
  34.       Height          =   330
  35.       Left            =   795
  36.       MaxLength       =   35
  37.       TabIndex        =   2
  38.       Top             =   2535
  39.       Width           =   4305
  40.    End
  41.    Begin VB.CommandButton cmdAbort 
  42.       Caption         =   "&Abort"
  43.       Height          =   300
  44.       Left            =   3285
  45.       TabIndex        =   5
  46.       Top             =   2970
  47.       Width           =   870
  48.    End
  49.    Begin VB.CommandButton cmdAddVar 
  50.       Caption         =   "&Add Variables"
  51.       Height          =   315
  52.       Left            =   1980
  53.       TabIndex        =   3
  54.       Top             =   2970
  55.       Width           =   1170
  56.    End
  57.    Begin VB.CommandButton cmdAdd 
  58.       Caption         =   "&Add "
  59.       Height          =   315
  60.       Left            =   5175
  61.       TabIndex        =   4
  62.       Top             =   2205
  63.       Width           =   840
  64.    End
  65.    Begin VB.TextBox txtNewVar 
  66.       BeginProperty Font 
  67.          name            =   "Fixedsys"
  68.          charset         =   0
  69.          weight          =   400
  70.          size            =   9
  71.          underline       =   0   'False
  72.          italic          =   0   'False
  73.          strikethrough   =   0   'False
  74.       EndProperty
  75.       Height          =   330
  76.       Left            =   795
  77.       MaxLength       =   20
  78.       TabIndex        =   1
  79.       Top             =   2175
  80.       Width           =   2535
  81.    End
  82.    Begin VB.ListBox lstVars 
  83.       BeginProperty Font 
  84.          name            =   "Fixedsys"
  85.          charset         =   0
  86.          weight          =   400
  87.          size            =   9
  88.          underline       =   0   'False
  89.          italic          =   0   'False
  90.          strikethrough   =   0   'False
  91.       EndProperty
  92.       Height          =   1860
  93.       ItemData        =   "AddVars.frx":0442
  94.       Left            =   105
  95.       List            =   "AddVars.frx":0444
  96.       TabIndex        =   0
  97.       Top             =   60
  98.       Width           =   5895
  99.    End
  100.    Begin VB.Label Label2 
  101.       Caption         =   "Desc :"
  102.       Height          =   285
  103.       Left            =   120
  104.       TabIndex        =   7
  105.       Top             =   2595
  106.       Width           =   570
  107.    End
  108.    Begin VB.Label Label1 
  109.       Caption         =   "Variable :"
  110.       Height          =   285
  111.       Left            =   120
  112.       TabIndex        =   6
  113.       Top             =   2190
  114.       Width           =   690
  115.    End
  116. Attribute VB_Name = "frmAddVariables"
  117. Attribute VB_Creatable = False
  118. Attribute VB_Exposed = False
  119. Dim CurIndex%
  120. Private Sub cmdAbort_Click()
  121.     Unload Me
  122. End Sub
  123. Private Sub cmdAdd_Click()
  124.     If txtNewVar.Text = "" Then
  125.         Beep
  126.     Else
  127.         lstStr$ = txtNewVar & Space(20 - Len(txtNewVar.Text)) & " " & Trim(txtNewVarDesc)
  128.         lstVars.AddItem lstStr$
  129.         lstVars.Refresh
  130.         txtNewVar.Text = ""
  131.         txtNewVarDesc.Text = ""
  132.         CurIndex = 0
  133.     End If
  134. End Sub
  135. Private Sub cmdAddVar_Click()
  136.     Dim i%
  137.     If lstVars.ListCount = 0 Then
  138.         Beep
  139.     Else
  140.         ReDim gParms(lstVars.ListCount - 1)
  141.         
  142.         For i = 0 To lstVars.ListCount - 1
  143.             gParms(i) = lstVars.List(i)
  144.         Next i
  145.     End If
  146.     Unload Me
  147. End Sub
  148. Private Sub cmdDel_Click()
  149.     If txtNewVar.Text = "" Or CurIndex < 0 Then
  150.         Beep
  151.     Else
  152.         lstVars.RemoveItem CurIndex
  153.         lstVars.Refresh
  154.         txtNewVar.Text = ""
  155.         txtNewVarDesc.Text = ""
  156.         CurIndex = 0
  157.     End If
  158. End Sub
  159. Private Sub Form_Unload(Cancel As Integer)
  160.     Set frmAddVariables = Nothing
  161. End Sub
  162. Private Sub lstVars_Click()
  163.     If lstVars.ListCount = 0 Then Exit Sub
  164.     CurIndex = lstVars.ListIndex
  165.     txtNewVar.Text = Mid(lstVars.List(CurIndex), 1, 20)
  166.     If Len(lstVars.List(CurIndex)) > 21 Then
  167.         txtNewVarDesc.Text = Mid(lstVars.List(CurIndex), 22, Len(lstVars.List(CurIndex)) - 21)
  168.     End If
  169. End Sub
  170.